package procedureandconsumer;

public class ThreadProducter extends Thread{
    private MyStack stack;

    public ThreadProducter(MyStack stack) {
        this.stack = stack;
    }

    @Override
    public void run() {
        while(true){
            System.out.println("生产者生产了一个产品，进行入栈操作");
            stack.push(new Object());
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
